package com.powernobug.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @Author: 肖云戈
 * @CreateTime: 2024-08-30
 * @Description:
 */
public class WebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    @Override
    protected Class<?>[] getRootConfigClasses() {
        // 内部的ApplicationContext的配置类
        return new Class[0];
    }
    // 提供配置类，用来初始化WebApplicationContext的
    @Override
    protected Class<?>[] getServletConfigClasses() {
        // 外部的ApplicationContext的配置类
        return new Class[]{SpringConfiguration.class};
    }

    // 提供DispatcherServlet的servlet-mapping的 → /
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
